package demo1;

class Shape {
    public void draw(){
        System.out.println("画一个图形！");
    }
}
class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("○");
    }
}
class Ract extends Shape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Angle extends Shape {
    @Override
    public void draw() {
        System.out.println("△");
    }
}

public class Test {

    public static void main(String[] args) {
        Shape shape = new Cycle();
        Shape shape1 = new Ract();
        Shape shape2 = new Angle();
        Shape[] shape3 = {new Cycle(),new Ract(),new Cycle(),new Ract(),new Angle()};
        for (Shape shapes : shape3
             ) {
            shapes.draw();
        }
    }
}
